import { redirect } from 'next/navigation';

interface StackHomePageProps {
  params: Promise<{
    stack: string;
  }>;
}

export async function generateStaticParams() {
  return [
    { stack: 'java-stack' },
    { stack: 'database' },
  ];
}

const indexMap: Record<string, string> = {
  'java-stack': 'jvm/basic-jvm',
  'database': 'message-middleware/compare',
}

export default async function StackHomePage({ params }: StackHomePageProps) {
  const { stack } = await params;
  
  // 直接重定向到默认分类
  redirect(`/blog/${stack}/${indexMap[stack]}`);
}